﻿package com.wandian.controller
{  
	import com.wandian.data.GameData;
	import com.wandian.model.vo.RoomVo;
	import com.wandian.view.mediator.GameRoomMediator;
	import com.wandian.view.mediator.MaskGameMediator;
	import com.wandian.view.mediator.VIPPrivilegeMediator;
	
	import flash.display.MovieClip;
	
	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.command.*;

    public class VIPPrivilegeCommand extends SimpleCommand
    {
        private var _global:GameData;
        private var _mcPanel:MovieClip;

        public function VIPPrivilegeCommand()
        {
            this._global = GameData.getInstance();
            return;
        }

        override public function execute(notification:INotification) : void
        {
            super.execute(notification);
            switch(notification.getName())
            {
                case CLZNoticeName.SHOW_VIP_PRIVILEGE:
                {
                    this.showVIPPrivilege();
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }

        private function showVIPPrivilege() : void
        {
            if (!this._mcPanel)
            {
                this._mcPanel = GameData.getMovieClip("VIPPanel");
            }
            if (!Texas.I._mcWindosView.contains(this._mcPanel))
            {
                Texas.I._mcWindosView.addChildTo(this._mcPanel);
                Texas.I._mcWindosView.centerXY(this._mcPanel);
            }
            facade.registerMediator(new VIPPrivilegeMediator(this._mcPanel));
            return;
        }

    }
}
